<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../taglibs.jsp" %>
<script type="text/javascript">
	$(function() {
		$("#query").click(function() {
			$("[name='pageNum']").val(1);
			$("form:first").submit();
		});
		var orderState = $("#orderState").val();
		var orderType = $("#orderType").val();
		//alert(orderState + "   "+orderType)
		if(orderState == "5" && orderType == "3"){
			$("#tab1").addClass("here");
			$("#tab1 a").addClass("taba");
		}else if(orderState == "6" && orderType == "3"){
			$("#tab2").addClass("here");
			$("#tab2 a").addClass("taba");
		}else if(orderState == "7" && orderType == "3"){
			$("#tab3").addClass("here");
			$("#tab3 a").addClass("taba");
		}
	});
	
	function popOrderDetail(orderId){
		var diag = new Dialog();
		diag.Width = 850;
		diag.Height = 400;
		diag.Title = "订单入库";
		diag.URL = "${path}/store_inDetail?orderModel.orderId="+orderId;
		diag.OKEvent = function(){
			/* //获得子页面的文档内容对象
			 var doc=diag.innerFrame.contentWindow;
			//alert(doc.age)
			var result = doc.submitOrder();
			if(result == "yes"){
				diag.close();
				window.location.href="${path }/orderModel_buy_list?erpQuery.orderState=1";
			} */
		};
		diag.show();
	}
</script>
<style>
	ul li{
		list-style-type: none;
		border: 1px solid #539200;
		float: left;
		margin-left: 2px;
		padding: 5px;
		width: 70px;
		border-bottom: 1px solid #F3FFE3;
		text-align: center;
	}
	
	.here{
		background-color: #539200;
		color: white;
		border-bottom: 1px solid #539200;
		font-size: 14px;
		font-weight: bold;
	}
	li a{
		text-decoration: none; color: black;
	}
	.taba{
		color: white;
		font-size: 14px;
		font-weight: bold;
	
	}
</style>
<div class="content-right">
	<div class="content-r-pic_w">
		<div style="margin:8px auto auto 12px;margin-top:6px">
			<span class="page_title">入库</span>
		</div>
	</div>
	<div class="content-text">
		<form action="${path }/store_inList" method="post">
			<input type="hidden" id="orderState" name="erpQuery.orderState" value="<s:property value="erpQuery.orderState"/>"> 
			<input type="hidden" id="orderType" name="erpQuery.orderTypeStr" value="<s:property value="erpQuery.orderTypeStr"/>">
			<div class="square-o-top">
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					style="font-size:14px; font-weight:bold; font-family:"黑体";">
					<tr>
						<td width="10%">订单号:</td>
						<td width="40%">
							<s:textfield name="erpQuery.orderNum" size="40"></s:textfield>
						</td>
						<td width="10%">跟单人:</td>
						<td width="25%"><s:textfield name="erpQuery.completerName" size="40"></s:textfield></td>
						<td width="15%"><a id="query"> 
							<img src="${path}/images/can_b_01.gif" border="0" /> </a>
						</td>
					</tr>
				</table>
			</div>
			<div>
				<ul>
					<li id="tab1"><a href="${path }/store_inList?erpQuery.orderState=5&erpQuery.orderTypeStr=3" >未入库</a></li>
					<li id="tab2"><a href="${path }/store_inList?erpQuery.orderState=6&erpQuery.orderTypeStr=3">入库中</a></li>
					<li id="tab3"><a href="${path }/store_inList?erpQuery.orderState=7&erpQuery.orderTypeStr=3" >已入库</a></li>
				</ul>
				
			</div>
			<!--"square-o-top"end-->
			<div class="square-order">
				<table width="100%" border="1" cellpadding="0" cellspacing="0">
					<tr align="center"
						style="background:url(${path}/images/table_bg.gif) repeat-x;">
						<td width="30%" height="30">订单号</td>
						<td width="20%">跟单人</td>
						<td width="20%">种类</td>
						<td width="20%">操作</td>
					</tr>
					<s:iterator value="#page.list" var="od">
					<tr align="center" bgcolor="#FFFFFF">
							<td height="30"><s:property value="#od.orderNum"/></td>
							<td><s:property value="#od.orderCompleter.name"/></td>
							<td><s:property value="#od.ods.size()"/></td>
							<td>
								<img src="${path}/images/icon_3.gif" /> 
								<span style="line-height:12px; text-align:center;"> 
									<a href="#" onclick="popOrderDetail(<s:property value="#od.orderId"/>)" class="xiu">详情
									</a> 
								</span>
							</td>
						</tr>
					</s:iterator>
						
						
				</table>
			</div>
		</form>
	</div>
	<div class="content-bbg"></div>
</div>
